/*
 * Tencent is pleased to support the open source community by making ovCompose available.
 * Copyright (C) 2025 THL A29 Limited, a Tencent company. All rights reserved.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.tencent.compose.sample.test

import androidx.compose.runtime.Immutable
import kotlinx.serialization.Serializable

/**
 * 测试配置数据模型
 */
@Immutable
@Serializable
data class TestConfig(
    val appVersion: String,
    val apiBaseUrl: String,
    val enableAnalytics: Boolean = true,
    val enableCrashReporting: Boolean = true,
    val enablePushNotifications: Boolean = true,
    val cacheExpirationTime: Long = 3600000L, // 1 hour
    val maxRetryAttempts: Int = 3,
    val timeoutDuration: Long = 30000L, // 30 seconds
    val features: Map<String, Boolean> = emptyMap(),
    val limits: Map<String, Int> = emptyMap()
)

/**
 * 测试统计数据结构
 */
@Immutable
@Serializable
data class TestStatistics(
    val totalUsers: Long,
    val activeUsers: Long,
    val totalOrders: Long,
    val totalRevenue: Double,
    val averageOrderValue: Double,
    val conversionRate: Double,
    val retentionRate: Double,
    val topProducts: List<ProductStats>,
    val monthlyGrowth: List<MonthlyGrowth>,
    val lastUpdated: Long = System.currentTimeMillis()
)

/**
 * 产品统计数据
 */
@Immutable
@Serializable
data class ProductStats(
    val productId: String,
    val productName: String,
    val salesCount: Int,
    val revenue: Double,
    val rating: Double
)

/**
 * 月度增长数据
 */
@Immutable
@Serializable
data class MonthlyGrowth(
    val month: String,
    val year: Int,
    val userGrowth: Double,
    val revenueGrowth: Double,
    val orderGrowth: Double
)